Skip to content

feat: expose --use_directml CLI flag (experimental)#290

Merged
beveradb merged 7 commits into
mainfrom
feat/sess-20260708-1415-directml-cli-support
Jul 8, 2026
Merged

feat: expose --use_directml CLI flag (experimental)#290
beveradb merged 7 commits into
mainfrom
feat/sess-20260708-1415-directml-cli-support

Conversation

@beveradb

@beveradb beveradb commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

What

Expose the existing DirectML acceleration through the CLI via a new --use_directml flag (experimental).

Why

A contributor reported that DirectML support (added in #211) works when constructing Separator(use_directml=True) from the Python API, but is unreachable from the CLI — there was no --use_directml argument and it was never forwarded to the constructor. It was an oversight in the original PR, not an intentional gate. This wires it up so CLI users on Windows AMD/Intel GPUs can enable it without editing source.

Changes

  • --use_directml CLI flag (cli.py) — explicit opt-in, mirroring --use_autocast; forwarded into the Separator(...) construction.
  • Discoverability hint (separator.py) — in the CPU-fallback path of setup_torch_device, if torch_directml or onnxruntime-directml is installed but DirectML wasn't enabled, log a one-line hint pointing to --use_directml. Fires during audio-separator --env_info on DirectML-capable machines.
  • README — new "🪟 Windows AMD / Intel GPU with DirectML (experimental)" install section with an honest per-architecture status matrix (MDX confirmed; MDXC/roformer & VR expected-but-untested; Demucs unverified), plus --use_directml added to the ToC, the full CLI-options reference, and the Separator class parameters list.
  • Version bumped to 0.44.3.
  • Tests — a CLI wiring test (test_cli.py) and two hint tests (test_directml.py).

Design notes

  • Experimental / best-effort tier — labelled experimental because there is no Windows + AMD/Intel GPU in CI and the maintainer can't test it directly.
  • Explicit opt-in only — DirectML does not auto-enable (unlike CUDA/MPS); enabling it for anyone who merely has torch_directml installed would be an untestable silent-regression risk. The DirectML branch remains reachable only when CUDA and MPS are both unavailable, so this cannot affect CUDA/MPS/CPU users.
  • Remote CLI intentionally untouched — DirectML is local-only; the remote separation servers run on CUDA/CPU, so plumbing it through audio_separator/remote/* would be dead config.

Testing

tests/unit/test_cli.py + tests/unit/test_directml.py: 21 passed, 2 skipped. Full unit suite collects cleanly (276 tests). No DirectML execution test — that can't run in CI; only the CLI→constructor wiring and the hint are tested.

Note: test_cli_multiple_filenames is a pre-existing, macOS-specific flaky test (a mock_open patch breaks stdlib platform.platform() depending on import order) — it fails identically on the base branch and is unrelated to this change.

@coderabbitai ignore

beveradb added 7 commits July 8, 2026 16:57
Contributor (Vageesha Gupta) reported DirectML support exists (PR #211)
but is unreachable from the CLI. Design: expose --use_directml as
explicit opt-in, add conditional discoverability hint, document as
experimental with an honest per-architecture status, ship a patch
release, and reply inviting validation of untested architectures.
Correct spec to drop remote-CLI scope: DirectML is local-only and the
remote separation servers run on CUDA/CPU, so plumbing use_directml
through audio_separator/remote/* would be dead config. Add 5-task TDD
plan (CLI flag, discoverability hint, README, version bump, reply draft).
Wire the existing Separator(use_directml=...) support (PR #211) to the
CLI, mirroring --use_autocast. Explicit opt-in only. Adds the fixture
key + a wiring test in test_cli.py.
…talled

In the CPU-fallback path of setup_torch_device, if torch_directml or
onnxruntime-directml is installed but DirectML wasn't enabled, log a
one-line INFO hint pointing to --use_directml. Fires during
'audio-separator --env_info' on DirectML-capable machines.
New install section with the dml extra, --use_directml usage, env_info
confirmation line, and an honest per-architecture status matrix. Also
adds --use_directml to the ToC, the full CLI-options reference, and the
Separator class parameters list.
@beveradb beveradb force-pushed the feat/sess-20260708-1415-directml-cli-support branch from 0ecaf7a to 22567a8 Compare July 8, 2026 20:58
@beveradb beveradb merged commit ee1fcee into main Jul 8, 2026
24 of 26 checks passed
@beveradb beveradb deleted the feat/sess-20260708-1415-directml-cli-support branch July 8, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant